<?php
	require_once 'ui/UIMenu.php';
	require_once 'AppController.php';
	
	//TESTING VARS:
		$id = 1;
	// END TESTING
	
	/*ID is representative, i.e. not ment to bee in URL in finished version*/
	if(!isset($_GET['id']) || empty($_GET['id'])) {	
		exit('id not set!');
	}
	else {
		//$id = $_GET['id'];//<-- TODO: get ID from other module..
		
		//get the event that's being worked on...
		$controller = new AppController();
		
		$event = $controller->getEvent($id);
		
		//form action:
		
	}
?>

<html>
<head>
	<meta charset="UTF-8">
	<link  rel="stylesheet" href="styles/appcreater.css">
	
	<script>
		function preview() {
			console.log("test");
		}
	</script>
	
</head>
<body>

	<div id="center">
		<div id="table_container">
			<form method="GET" action="AppCreater.php">
				<table>
					<tr>
						<td>
							<span class="col1">
								Event navn:
							</span>
							<span class="col2">
								<?php echo $event->name;?> 
							</span>
						</td>
					</tr>
					<tr>
						<td>
							<span class="col1">
								Logo:
							</span>
							<span class="col2">
								<input type="file" name="file_logo" accept="image/jpeg, image/png, image/bmp"> 
							</span>
							
						</td>
					</tr>
					<tr>
						<td>
						
							<span class="col1">
								Menu:
							</span>
							<span class="col2">
								<iframe id="menu_container" src="menuForm.php">
								</iframe>
							</span>
						
						</td>
					</tr>
					<tr>
						<td>
							<span class="col1">
								<button id="btn_preview" onclick="preview()"> Forhåndsvisning </button>
							</span>
							<span class="col2">&nbsp</span>
							<span class="col3">
								<input type="submit" name="save" value="Gem">
							</span>
						</td>
					</tr>
				</table>
				<!-- temp id  holder
				<input type="text" name="id" style="visibility: hidden;" value="<?php echo $id?>">
				-->
			</form>
		</div>
	</div>
</div>
</body>
</html>